package com.shop.controller;

import com.shop.pojo.pms.Pms_Category;
import com.shop.pojo.pms.Pms_Sku_Info;
import com.shop.service.Pms_SkuInfo_Service;
import com.shop.utils.R;
import com.shop.vo.SkuItemSaleAttrVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

import java.math.BigDecimal;

@RestController
@RequestMapping("/skuInfo")
public class Pms_SkuInfo_Controller {

    @Autowired
    private Pms_SkuInfo_Service pms_skuInfo_service;

    /**
     * 根据商品的ID查询商品的最新价格
     * @param skuId
     * @return
     */
    @GetMapping("/getZuiXinPrice/{skuId}")
    public BigDecimal getZuiXinPrice(@PathVariable("skuId") long skuId){

        return pms_skuInfo_service.getZuiXinPrice(skuId);
    }





    /**
     * 根据商品的sku_Id查询出该商品信息
     * @param skuId
     * @return
     */
    @GetMapping("/get_web_SkuInfo_ByID/{skuId}")
    public Pms_Sku_Info get_web_SkuInfo_ByID(@PathVariable("skuId") Long skuId){
        return pms_skuInfo_service.get_web_SkuInfo_ByID(skuId);
    }

    @PutMapping("/exitSkuInfo")
    public R exitSkuInfo(Pms_Sku_Info pms_sku_info){

        return pms_skuInfo_service.exitSkuInfo(pms_sku_info);
    }

    @GetMapping("/getrandThree")
    public List<Pms_Sku_Info> getQueryThree(){

        return pms_skuInfo_service.getQueryByThree();
    }


}
